:root {
    --primary-color: #4a90e2;
    --secondary-color: #f5f5f5;
    --text-color: #333;
    --border-color: #ddd;
    --error-color: #e74c3c;
    --success-color: #2ecc71;
    --hover-color: #357abd;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--secondary-color);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

h1 {
    color: var(--primary-color);
    font-size: 24px;
}

.search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-bar input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
}

button {
    padding: 8px 16px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

button:hover {
    background-color: var(--hover-color);
}

button.cancel-btn {
    background-color: #666;
}

button.cancel-btn:hover {
    background-color: #555;
}

button.delete-btn {
    background-color: var(--error-color);
}

button.delete-btn:hover {
    background-color: #c0392b;
}

.content {
    display: grid;
    gap: 20px;
}

.apps-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.app-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.app-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.app-card h3 {
    margin-bottom: 10px;
    color: var(--primary-color);
}

.app-info {
    margin-bottom: 15px;
}

.app-project {
    color: var(--primary-color);
    font-weight: 500;
    margin-bottom: 8px;
}

.app-description {
    color: #666;
    margin-bottom: 8px;
    line-height: 1.4;
}

.app-meta {
    display: flex;
    gap: 15px;
    font-size: 0.9em;
    color: #888;
}

.app-version, .app-author {
    display: inline-flex;
    align-items: center;
}

.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.app-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.modal-content {
    position: relative;
    background-color: white;
    margin: 50px auto;
    padding: 20px;
    width: 90%;
    max-width: 600px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.modal-content h2 {
    margin-bottom: 20px;
    color: var(--primary-color);
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #666;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
}

.location-input {
    display: flex;
    gap: 10px;
}

.location-input input {
    flex: 1;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.file-browser {
    margin: 20px 0;
    max-height: 400px;
    overflow-y: auto;
}

.file-browser-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding: 10px;
    background-color: var(--secondary-color);
    border-radius: 4px;
}

.file-list {
    display: grid;
    gap: 5px;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.file-item:hover {
    background-color: var(--secondary-color);
}

.file-icon {
    font-size: 18px;
}

.status-message {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 10px 20px;
    border-radius: 4px;
    background-color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
}

.status-message.success {
    background-color: var(--success-color);
    color: white;
}

.status-message.error {
    background-color: var(--error-color);
    color: white;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.edit-modal {
    width: 95%;
    max-width: 1200px;
    height: 90vh;
    display: flex;
    flex-direction: column;
}

.edit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.edit-tabs {
    display: flex;
    gap: 10px;
}

.tab-btn {
    padding: 8px 16px;
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-color);
}

.tab-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.edit-content {
    flex: 1;
    display: flex;
    gap: 20px;
    overflow: hidden;
}

.tab-content {
    display: none;
    flex: 1;
    overflow: hidden;
}

.tab-content.active {
    display: block;
}

.edit-toolbar {
    width: 250px;
    background: var(--secondary-color);
    padding: 15px;
    border-radius: 4px;
}

.component-list {
    display: grid;
    gap: 10px;
}

.component-item {
    padding: 10px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: move;
    text-align: center;
}

.component-item:hover {
    background: var(--hover-color);
    color: white;
}

.edit-canvas {
    flex: 1;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 20px;
    overflow: auto;
    min-height: 500px;
}

.code-editor {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.editor-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.editor-tab {
    padding: 8px 16px;
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-color);
}

.editor-tab.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.editor-content {
    flex: 1;
    overflow: hidden;
}

.editor-content textarea {
    width: 100%;
    height: 100%;
    padding: 15px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
    font-size: 14px;
    line-height: 1.5;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    resize: none;
}

.preview-container {
    width: 100%;
    height: 100%;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 20px;
    overflow: auto;
}

.edit-btn {
    background-color: #2ecc71;
}

.edit-btn:hover {
    background-color: #27ae60;
}

/* 拖拽时的样式 */
.dragging {
    opacity: 0.5;
}

.drop-target {
    border: 2px dashed var(--primary-color);
}

/* 编辑器样式 */
.editor-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: var(--secondary-color);
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: white;
    border-bottom: 1px solid var(--border-color);
}

.editor-header h1 {
    margin: 0;
    font-size: 1.5em;
    color: var(--primary-color);
}

.editor-actions {
    display: flex;
    gap: 10px;
}

.editor-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.editor-sidebar {
    width: 250px;
    background: white;
    border-right: 1px solid var(--border-color);
    padding: 20px;
    overflow-y: auto;
}

.component-list h3 {
    margin: 0 0 15px 0;
    color: var(--text-color);
}

.component-item {
    padding: 10px;
    background: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-bottom: 10px;
    cursor: move;
    transition: all 0.2s;
}

.component-item:hover {
    background: var(--hover-color);
    color: white;
}

.editor-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
    overflow: hidden;
}

.editor-tabs {
    display: flex;
    gap: 10px;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
}

.tab-btn {
    padding: 8px 16px;
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.tab-content {
    flex: 1;
    overflow: hidden;
    padding: 20px;
}

/* 组件样式 */
.component-wrapper {
    height: 100%;
    padding: 10px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.component-button {
    width: 100%;
    padding: 8px 16px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.component-input {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.component-label {
    display: block;
    padding: 8px;
    color: var(--text-color);
}

/* Monaco编辑器样式 */
#monaco-editor {
    width: 100%;
    height: 100%;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

/* 预览容器样式 */
.preview-container {
    width: 100%;
    height: 100%;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 20px;
    overflow: auto;
}

/* 状态消息样式 */
.status-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 10px 20px;
    border-radius: 4px;
    color: white;
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
}

.status-message.success {
    background: var(--success-color);
}

.status-message.error {
    background: var(--error-color);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
} 